<h2 class='nika_page_title'>Список тем</h2>

<?php include_partial('menu') ?>

<?php if($sf_user->hasFlash('topic_created')):?>
<div class="flashmsg success">Тема успешно создана</div>
<?php endif;?>

<div class="paginate">
<?php if ($pager->haveToPaginate()): ?>
    <?php include_partial('paginate', array('pager' => $pager)) ?>
<?php endif; ?>
</div>

<table id="sfForumTopicIndex">
    <thead>
        <tr>
            <th>Тема</th>
            <th>Автор</th>
            <th>Просмотров</th>
            <th>Создана</th>
            <th>Обновлена</th>
        </tr>
    </thead>
    <tbody>
        <?php foreach($pager->getResults() as $topic): ?>
        <tr onclick="document.location.href='<?php echo url_for('sfForumTopic/show?id='.$topic->getId()) ?>'">
            <td>
                <?php echo link_to($topic->getName(),'sfForumTopic/show?id='.$topic->getId()) ?>
            </td>
            <td><?php echo $topic['userfirst'].' '.$topic['userlast'] ; ?></td>
            <td class='textcenter'><?php echo $topic->getHits() ?></td>
            <td class='textcenter'><?php echo $topic->getCreatedAt() ?></td>
            <td class='textcenter'><?php echo $topic->getUpdatedAt() ?></td>
        </tr>
        <?php endforeach; ?>
    </tbody>
</table>

<div class="paginate">
<?php if ($pager->haveToPaginate()): ?>
    <?php include_partial('paginate', array('pager' => $pager)) ?>
<?php endif; ?>
</div>

